﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Gestion.Core.Service;

namespace Gestion.Ui
{
    public class BaseUserControl : UserControl
    {

        private String _validationGroup = null;

        public String ValidationGroup
        {
            get { return _validationGroup; }
            set
            {
                foreach (Control c in Controls)
                {
                    if (c is BaseValidator)
                    {
                        BaseValidator validator = (BaseValidator)c;
                        validator.ValidationGroup = value;
                    }
                }
                _validationGroup = value;
            }
        }


        private ServiceManager _serviceManager;
        protected ServiceManager ServiceManager
        {
            get
            {
                return _serviceManager;
            }
            set
            {
                _serviceManager = value;
            }
        }

        public BaseUserControl()
        {
            //this.ServiceManager = BSSTApplicationModule.getServiceManager();
            this.ServiceManager = ApplicationModule.GetPlainServiceManager();
        }

        
    }
}
